package com.vitabuybuy.tv.dto;

import com.vitabuybuy.tv.utils.LanaugeUtils;

import java.io.Serializable;
import java.util.List;

/**
 * 作者：SimGa
 * 日期：2020/12/16
 * 时间：11:00
 * 包名：com.vitabuybuy.tv.dto
 */
public class OrderListDto {
    private String orderNumber;
    private double goodsAmount;
    private int goodsQuantity;
    private int id;
    /**
     * name : 优衣库官方旗舰店
     * logo : http://106.55.47.138/attachment/jpg/3704/853_7490.jpg
     * id : 62
     */

    private StoreBean store;
    private String type;
    private double paymentAmount;
    private String status;
    /**
     * amount : 796.0
     * product : {"thumbnail":"http://106.55.47.138/attachment/jpg/5452/1132_5326.jpg","name":"{\"EN\":\"Uniqlo men's wear shirt\",\"CN\":\"优衣库男装衬衫\",\"MA\":\"baju lelaki UNIQLO\"}","id":67}
     * quantity : 4
     * price : 199.0
     * id : 203
     * specifications : {"EN":"M","CN":"中","MA":"tengah"};{"EN":"brown","CN":"棕色","MA":"coklat"}
     */

    private List<OrderDetailDto.ItemListBean> itemList;
    private List<OrderListDto> childList;


    public String getOrderNumber() {
        return orderNumber;
    }

    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
    }

    public double getGoodsAmount() {
        return goodsAmount;
    }

    public void setGoodsAmount(double goodsAmount) {
        this.goodsAmount = goodsAmount;
    }

    public int getGoodsQuantity() {
        return goodsQuantity;
    }

    public void setGoodsQuantity(int goodsQuantity) {
        this.goodsQuantity = goodsQuantity;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public StoreBean getStore() {
        return store;
    }

    public void setStore(StoreBean store) {
        this.store = store;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public double getPaymentAmount() {
        return paymentAmount;
    }

    public void setPaymentAmount(double paymentAmount) {
        this.paymentAmount = paymentAmount;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public List<OrderDetailDto.ItemListBean> getItemList() {
        return itemList;
    }

    public void setItemList(List<OrderDetailDto.ItemListBean> itemList) {
        this.itemList = itemList;
    }

    public List<OrderListDto> getChildList() {
        return childList;
    }

    public void setChildList(List<OrderListDto> childList) {
        this.childList = childList;
    }

    public static class StoreBean {
        private String name;
        private String logo;
        private int id;

        public String getName() {
            return LanaugeUtils.returnStrByLocation(name);
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getLogo() {
            return logo;
        }

        public void setLogo(String logo) {
            this.logo = logo;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }
    }

    public static class ItemListBean implements Serializable {
        private double amount;
        /**
         * thumbnail : http://106.55.47.138/attachment/jpg/5452/1132_5326.jpg
         * name : {"EN":"Uniqlo men's wear shirt","CN":"优衣库男装衬衫","MA":"baju lelaki UNIQLO"}
         * id : 67
         */

        private ProductBean product;
        private ProductBean goods;
        private int quantity;
        private double price;
        private int id;
        private String specifications;

        public ProductBean getGoods() {
            return goods;
        }

        public void setGoods(ProductBean goods) {
            this.goods = goods;
        }

        public double getAmount() {
            return amount;
        }

        public void setAmount(double amount) {
            this.amount = amount;
        }

        public ProductBean getProduct() {
            return product;
        }

        public void setProduct(ProductBean product) {
            this.product = product;
        }

        public int getQuantity() {
            return quantity;
        }

        public void setQuantity(int quantity) {
            this.quantity = quantity;
        }

        public double getPrice() {
            return price;
        }

        public void setPrice(double price) {
            this.price = price;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getSpecifications() {
            String[] split = specifications.split(";");
            specifications = "";
            for (String spec : split) {
                String str = LanaugeUtils.returnStrByLocation(spec);
                specifications = specifications.concat(str).concat(";");
            }
            return specifications.isEmpty() ? specifications : specifications.substring(0, specifications.length() - 1);

        }

        public void setSpecifications(String specifications) {
            this.specifications = specifications;
        }

        public static class ProductBean implements Serializable{
            private String thumbnail;
            private String name;
            private String image;
            private int id;

            public String getImage() {
                return image;
            }

            public void setImage(String image) {
                this.image = image;
            }

            public String getThumbnail() {
                return thumbnail;
            }

            public void setThumbnail(String thumbnail) {
                this.thumbnail = thumbnail;
            }

            public String getName() {
                return LanaugeUtils.returnStrByLocation(name);
            }

            public void setName(String name) {
                this.name = name;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }
        }
    }

}
